package cn.bdqn.demo1;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * @Description TODO
 * @Date 2020/2/14 9:36
 * @Created by 张三三
 */
public class Advice {

    public void before(){
        System.out.println("前置");
    }

    public void afterReturning(){
        System.out.println("后置");
    }

    public void around(ProceedingJoinPoint pjp) {
        System.out.println("环绕前置");
        try {
            pjp.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("环绕后置");
    }

    public void exception(){
        System.out.println("异常通知");
    }

    public void after(){
        System.out.println("最终");
    }

}
